/**
 * Created by kangdaye on 16/6/13.
 */
app.factory('orderListCache', function() {
    return{
        listTab : [
            {id : 0,name : '所有订单'},
            {id : 1,name : '待付款',status : 0},
            {id : 2,name : '待发货',status : 1},
            {id : 3,name : '待收货',status : 2},
            {id : 4,name : '已收货',status : 3},
            {id : 6,name : '退款中',status : 4,applyRefund:true},
            {id : 5,name : '已退款',status : 4},
            {id : 7,name : '已关闭',status : 5}
        ],
        detailListHeader : [
            {displayName:'商品', width:'40%',cellTemplate:'' +
                '<div>' +
                    '<img ng-src="{{row.image}}" width="60" height="60" class="f-l  mr-10">' +
                    '<div class="ta-l order-info-main">' +
                        '<div class="goods-title">{{row.title}}</div>' +
                    '</div>' +
                '</div>'
            },
            {displayName:'重量(KG)', field: 'weight', width:'15%'},
            {displayName:'数量', field: 'buyNumber', width:'10%'},
            {displayName:'单价(元)', field: 'id', width:'15%',cellTemplate:'' +
                '<div>' +
                    '<s class="d-b" ng-if="row.originPrice > row.price">¥{{row.originPrice}}</s>'+
                    '<p>¥{{row.price}}</p>'+
                '</div>'
            },
            {displayName:'状态', field: 'id', width:'20%',cellTemplate:'' +
                '<div>' +
                    '{{!evt.entity.orderDetailData.status ? "待支付" : ""}}'+
                    '{{evt.entity.orderDetailData.refundStatus != 1 && evt.entity.orderDetailData.status == 1 ? "待发货" : ""}}'+
                    '{{evt.entity.orderDetailData.refundStatus != 1 && evt.entity.orderDetailData.status == 2 ? "待收货" : ""}}'+
                    '{{evt.entity.orderDetailData.refundStatus != 1 && evt.entity.orderDetailData.status == 3 ? "已收货" : ""}}'+
                    '{{evt.entity.orderDetailData.status == 4 ? "已退款" : ""}}'+
                    '{{evt.entity.orderDetailData.status == 5 ? "已关闭" : ""}}'+
                    '{{evt.entity.orderDetailData.refundStatus == 1 ? "申请退款" : ""}}'+
                '</div>'
            }
        ]
    }
});
